/*
 * @Author: Jiraiya
 * @Date: 2020-05-26 19:25:08
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-05-26 19:25:08
 * @Description: 
 */ 
function createThunkMiddleware(extraArgument) {
    return ({ dispatch, getState }) => (next) => (action) => {
      if (typeof action === 'function') {
        return action(dispatch, getState, extraArgument);
      }
  
      return next(action);
    };
  }
  
  const thunk = createThunkMiddleware();
  thunk.withExtraArgument = createThunkMiddleware;
  
  export default thunk;